home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / PovLab / povlab / OS2 / SETUPOS2.CMD < prev    next >
Encoding:
Text File  |  1999-08-29  |  3.0 KB  |  116 lines

  1. /* REXX Program to make WPS object for POVLAB program */
  2.  
  3. /* Clearscreen */
  4. 'cls'
  5.  
  6. /* Intro */
  7. say ""
  8. say "Welcome to POVLAB's OS/2 setup program."
  9. say ""
  10. say "POVLAB is a DOS based modelling program"
  11. say "for the Persistance of Vision Raytracer."
  12. say ""
  13. say "This install routine will create a WPS"
  14. say "icon on the desktop with the required"
  15. say "settings...."
  16.  
  17. /* Required system fuctions */
  18. Call rxfuncadd sysloadfuncs, rexxutil, sysloadfuncs
  19. Call sysloadfuncs
  20.  
  21. /* Get path */
  22. fullpath=Directory()
  23. if right(fullpath, 1) \= "\" then do
  24.     fullpath = fullpath || "\"
  25. end
  26.  
  27. /* Ask if "fullpath" is where POVLAB is located */
  28. say ""
  29. say "Is" fullpath
  30. reply = GetYesNo("the directory where you unzipped POVLAB")
  31.  
  32. /* If no then leave */
  33. if \reply then do
  34.     say ""
  35.     say "Please run the install program from a fullscreen DOS"
  36.     say "prompt and then rerun this program from an OS/2 shell"
  37.     say "within the POVLAB directory."
  38.     say ""
  39.     say "Exiting setup....."
  40.     exit
  41.     end
  42.  
  43. /* Otherwise explain the procedure */
  44. say ""
  45. say "POVLAB's setup program will now create a POVLAB icon on"
  46. say "the Desktop, complete with associations....."
  47. call SysSleep 3
  48.  
  49. /* Check for POVLAB executable */
  50. drop res.
  51. call SysFileTree fullpath || "POVLAB.EXE", res, "OF"
  52.  
  53. /* Not found */
  54. if res.1 = "RES.1" then do
  55.     say ""
  56.     say "Can't find the POVLAB executable in the specified directory."
  57.     say "Please install POVLAB, switch to the install directory and"
  58.     say "rerun this setup program."
  59.     say ""
  60.     say "Exiting setup....."
  61.     exit
  62. end
  63.  
  64. /* Found */
  65. else do
  66.  
  67.     /* Copy "povlabic.os2" to "povlab.ico" */
  68.     'echo off'
  69.     'copy povlabic.os2 povlab.ico'
  70.     'cls'
  71.  
  72.     /* Setup associations and create WPS object */
  73.     assoc = '*.SCN'
  74.     Call SysCreateObject 'WPProgram','POVLAB','<WP_DESKTOP>','CCVIEW=NO;EXENAME='||fullpath||'\POVLAB.EXE;PROGTYPE=VDM;STARTUPDIR='||fullpath||';SET COM_HOLD=OFF;SET COM_SELECT=NONE;SET DPMI_DOS_API=ENABLED;SET DPMI_MEMORY_LIMIT=8;ASSOCFILTER='||assoc,'R'
  75.  
  76.     /* Announce we're finished */
  77.     say ""
  78.     say "Desktop icon for POVLAB successfully created."
  79.     say ""
  80.  
  81.     /* Small warning */
  82.     say "NOTE:  As of yet, POVLAB is unable to spawn the DOS version of"
  83.     say "       POV-Ray directly under OS/2."
  84.     say "       To render a given scene, select -->POV-Ray (.pov) from"
  85.     say "       the File menu and render manually from a DOS shell."
  86.     say ""
  87.     say "       When the OS/2 version of POV-Ray 3.0 is released, this"
  88.     say "       Setup will be updated."
  89.     say ""
  90.     say "Enjoy POVLAB!!!!"
  91.  
  92. end
  93. exit
  94.  
  95. /* Execution should have terminated by this point */
  96.  
  97. /* Subroutine "GetYesNo" */
  98. GetYesNo: procedure
  99. ok = 0
  100.  
  101. /* Loop until a "Y" or "N" is entered */
  102. do until ok
  103.    call charout, arg(1) || "? "
  104.    pull reply
  105.    reply = left(reply, 1)
  106.    ok = (reply = "Y") | (reply = "N")
  107.    if \ok then do
  108.       say
  109.       say 'Please enter "Y" or "N".'
  110.       end
  111.    end
  112.  
  113. /* Return 1 for "Yes", 0 for "No" */
  114. return (reply = "Y")
  115.  
  116.